// cloudfunctions/getCollection/index.js
const cloud = require('wx-server-sdk');
cloud.init();

const db = cloud.database();
const collection = db.collection('collectText');

exports.main = async (event, context) => {
  try {
    const result = await collection.get();
    return result;
  } catch (err) {
    console.error(err);
    return err;
  }
};
